package com.leapp.sk.ui.activity.classs

import android.content.Intent
import android.os.Bundle
import android.view.View
import com.example.mvp.activity.BaseActivityMVP
import com.example.mvp.binder.BaseDataBinder
import com.example.mvp.view.CabcelSureDialog
import com.leapp.sk.R
import com.leapp.sk.binder.BaseBinder
import com.leapp.sk.util.wxentry.WXLoginUtil
import com.leapp.sk.viewdelegate.classs.GroupMamagerDelgate

/**
 * 群管理
 * @author  chaohaipeng  on 2018/8/1.
 */
class GroupManagerActivity: BaseActivityMVP<GroupMamagerDelgate>(){
    /**
     * dialog
     */
    private var cabcelSureDialog: CabcelSureDialog? = null
    override fun initView(p0: Bundle?) {
        viewDelegate.setTitle(resources.getString(R.string.string_group_manager))
    }

    override fun initDate() {
        cabcelSureDialog = CabcelSureDialog(this, com.example.baselibrary.R.style.dialog_style)
        cabcelSureDialog?.setDialogContent(resources.getString(R.string.string_group_class_delete_dialog))
    }

    override fun bindEvenListener() {
        viewDelegate.setOnClickListener(View.OnClickListener {
            val intent= Intent(this, ClassManagerTransferActivity::class.java)
            this.startActivity(intent)

        }, R.id.rl_agm_class_transfer)
        viewDelegate.setOnClickListener(View.OnClickListener {
            cabcelSureDialog?.show()
        }, R.id.rl_agm_class_delete)
        cabcelSureDialog?.setEventInterface(object : CabcelSureDialog.DialogEventInterface {
            override fun leftOnClick() {
                cabcelSureDialog?.cancel()
            }
            override fun rightOnClick() {
                cabcelSureDialog?.cancel()
            }
        })
    }

    override fun getDelegateClass(): Class<GroupMamagerDelgate> {
        return GroupMamagerDelgate::class.java
    }

    override fun getDataBinder(): BaseDataBinder<*, *> {
        return BaseBinder()
    }
}